# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models

class Migration(SchemaMigration):

    def forwards(self, orm):
        
        # Adding model 'Attribute'
        db.create_table('exploration_attribute', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('name', self.gf('django.db.models.fields.CharField')(unique=True, max_length=200)),
            ('description', self.gf('django.db.models.fields.TextField')(blank=True)),
        ))
        db.send_create_signal('exploration', ['Attribute'])

        # Adding model 'Object'
        db.create_table('exploration_object', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('name', self.gf('django.db.models.fields.CharField')(unique=True, max_length=200)),
            ('description', self.gf('django.db.models.fields.TextField')(blank=True)),
        ))
        db.send_create_signal('exploration', ['Object'])

        # Adding M2M table for field attributes on 'Object'
        db.create_table('exploration_object_attributes', (
            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
            ('object', models.ForeignKey(orm['exploration.object'], null=False)),
            ('attribute', models.ForeignKey(orm['exploration.attribute'], null=False))
        ))
        db.create_unique('exploration_object_attributes', ['object_id', 'attribute_id'])

        # Adding model 'ObjectImplication'
        db.create_table('exploration_objectimplication', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('is_confirmed', self.gf('django.db.models.fields.BooleanField')(default=False)),
        ))
        db.send_create_signal('exploration', ['ObjectImplication'])

        # Adding M2M table for field premise on 'ObjectImplication'
        db.create_table('exploration_objectimplication_premise', (
            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
            ('objectimplication', models.ForeignKey(orm['exploration.objectimplication'], null=False)),
            ('object', models.ForeignKey(orm['exploration.object'], null=False))
        ))
        db.create_unique('exploration_objectimplication_premise', ['objectimplication_id', 'object_id'])

        # Adding M2M table for field conclusion on 'ObjectImplication'
        db.create_table('exploration_objectimplication_conclusion', (
            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
            ('objectimplication', models.ForeignKey(orm['exploration.objectimplication'], null=False)),
            ('object', models.ForeignKey(orm['exploration.object'], null=False))
        ))
        db.create_unique('exploration_objectimplication_conclusion', ['objectimplication_id', 'object_id'])

        # Adding M2M table for field minimal_generator on 'ObjectImplication'
        db.create_table('exploration_objectimplication_minimal_generator', (
            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
            ('objectimplication', models.ForeignKey(orm['exploration.objectimplication'], null=False)),
            ('object', models.ForeignKey(orm['exploration.object'], null=False))
        ))
        db.create_unique('exploration_objectimplication_minimal_generator', ['objectimplication_id', 'object_id'])

        # Adding model 'AttributeImplication'
        db.create_table('exploration_attributeimplication', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('is_confirmed', self.gf('django.db.models.fields.BooleanField')(default=False)),
        ))
        db.send_create_signal('exploration', ['AttributeImplication'])

        # Adding M2M table for field premise on 'AttributeImplication'
        db.create_table('exploration_attributeimplication_premise', (
            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
            ('attributeimplication', models.ForeignKey(orm['exploration.attributeimplication'], null=False)),
            ('attribute', models.ForeignKey(orm['exploration.attribute'], null=False))
        ))
        db.create_unique('exploration_attributeimplication_premise', ['attributeimplication_id', 'attribute_id'])

        # Adding M2M table for field conclusion on 'AttributeImplication'
        db.create_table('exploration_attributeimplication_conclusion', (
            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
            ('attributeimplication', models.ForeignKey(orm['exploration.attributeimplication'], null=False)),
            ('attribute', models.ForeignKey(orm['exploration.attribute'], null=False))
        ))
        db.create_unique('exploration_attributeimplication_conclusion', ['attributeimplication_id', 'attribute_id'])

        # Adding M2M table for field minimal_generator on 'AttributeImplication'
        db.create_table('exploration_attributeimplication_minimal_generator', (
            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
            ('attributeimplication', models.ForeignKey(orm['exploration.attributeimplication'], null=False)),
            ('attribute', models.ForeignKey(orm['exploration.attribute'], null=False))
        ))
        db.create_unique('exploration_attributeimplication_minimal_generator', ['attributeimplication_id', 'attribute_id'])

        # Adding model 'Event'
        db.create_table('exploration_event', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('type', self.gf('django.db.models.fields.CharField')(max_length=20)),
            ('time', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
            ('author', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])),
            ('annotation', self.gf('django.db.models.fields.TextField')(blank=True)),
        ))
        db.send_create_signal('exploration', ['Event'])


    def backwards(self, orm):
        
        # Deleting model 'Attribute'
        db.delete_table('exploration_attribute')

        # Deleting model 'Object'
        db.delete_table('exploration_object')

        # Removing M2M table for field attributes on 'Object'
        db.delete_table('exploration_object_attributes')

        # Deleting model 'ObjectImplication'
        db.delete_table('exploration_objectimplication')

        # Removing M2M table for field premise on 'ObjectImplication'
        db.delete_table('exploration_objectimplication_premise')

        # Removing M2M table for field conclusion on 'ObjectImplication'
        db.delete_table('exploration_objectimplication_conclusion')

        # Removing M2M table for field minimal_generator on 'ObjectImplication'
        db.delete_table('exploration_objectimplication_minimal_generator')

        # Deleting model 'AttributeImplication'
        db.delete_table('exploration_attributeimplication')

        # Removing M2M table for field premise on 'AttributeImplication'
        db.delete_table('exploration_attributeimplication_premise')

        # Removing M2M table for field conclusion on 'AttributeImplication'
        db.delete_table('exploration_attributeimplication_conclusion')

        # Removing M2M table for field minimal_generator on 'AttributeImplication'
        db.delete_table('exploration_attributeimplication_minimal_generator')

        # Deleting model 'Event'
        db.delete_table('exploration_event')


    models = {
        'auth.group': {
            'Meta': {'object_name': 'Group'},
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
            'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
        },
        'auth.permission': {
            'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
            'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
        },
        'auth.user': {
            'Meta': {'object_name': 'User'},
            'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
            'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
            'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
            'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
            'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
            'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
        },
        'contenttypes.contenttype': {
            'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
            'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
        },
        'exploration.attribute': {
            'Meta': {'object_name': 'Attribute'},
            'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '200'})
        },
        'exploration.attributeimplication': {
            'Meta': {'object_name': 'AttributeImplication'},
            'conclusion': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'conclusion_set+'", 'symmetrical': 'False', 'to': "orm['exploration.Attribute']"}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'is_confirmed': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'minimal_generator': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'mingen_set+'", 'symmetrical': 'False', 'to': "orm['exploration.Attribute']"}),
            'premise': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'premise_set+'", 'symmetrical': 'False', 'to': "orm['exploration.Attribute']"})
        },
        'exploration.event': {
            'Meta': {'ordering': "['-time']", 'object_name': 'Event'},
            'annotation': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            'author': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'time': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
            'type': ('django.db.models.fields.CharField', [], {'max_length': '20'})
        },
        'exploration.object': {
            'Meta': {'object_name': 'Object'},
            'attributes': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['exploration.Attribute']", 'symmetrical': 'False', 'blank': 'True'}),
            'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '200'})
        },
        'exploration.objectimplication': {
            'Meta': {'object_name': 'ObjectImplication'},
            'conclusion': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'conclusion_set+'", 'symmetrical': 'False', 'to': "orm['exploration.Object']"}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'is_confirmed': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'minimal_generator': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'mingen_set+'", 'symmetrical': 'False', 'to': "orm['exploration.Object']"}),
            'premise': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'premise_set+'", 'symmetrical': 'False', 'to': "orm['exploration.Object']"})
        }
    }

    complete_apps = ['exploration']
